<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('防疫人员信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <input type="text" name="userName" placeholder="姓名"/>
                            </li>
                            <li>
                                <input type="text" name="phonenumber" placeholder="手机号码"/>
                            </li>
                            <!-- <li>
                                <input type="text" name="leadOrg" placeholder="负责统筹单位"/>
                            </li>
                            <li>
                                <input type="text" name="fromOrg" placeholder="来源单位"/>
                            </li> -->
                            <li>
                                <select name="userType" th:with="type=${@dict.getType('fym_user_type')}" onchange="$.table.search();">
                                    <option value='' disabled selected style='display:none;'>类别</option>  
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
								<a class="btn btn-success btn-sm" onclick="$.table.search()">&nbsp;搜索</a>
							</li>
                            
							<div class="btn-group-sm" id="toolbar2" role="group">
				                <a class="btn btn-white multiple disabled" onclick="$.operate.editMultiple(null,'批量发送短信')" shiro:hasPermission="fym:user:edit">
				                    <i class="fa fa-edit"></i> 发送短信
				                </a>
				                <a class="btn btn-outline btn-success btn-sm " onclick="$.operate.add()" shiro:hasPermission="fym:user:add">
				                    <i class="fa fa-plus"></i> 精准添加
				                </a>
				                <!-- <a class="btn btn-white btn-sm multiple disabled" onclick="$.operate.edit()" shiro:hasPermission="fym:user:edit">
				                    <i class="fa fa-edit"></i> 修改
				                </a> -->
				                <a class="btn btn-white btn-sm multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="fym:user:remove">
				                    <i class="fa fa-remove"></i> 批量删除
				                </a>
				                <a class="btn btn-link btn-sm" onclick="$.table.importExcel()" shiro:hasPermission="fym:user:import">
				                    <i class="fa fa-upload"></i> 导入
				                </a>
				                <a class="btn btn-link btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="fym:user:export">
				                    <i class="fa fa-download"></i> 导出
				                </a>
				            </div>
                        </ul>
                    </div>
                </form>
            </div>

            <!-- <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="fym:user:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="fym:user:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="fym:user:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="fym:user:import">
		            <i class="fa fa-upload"></i> 导入
		        </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="fym:user:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div> -->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('fym:user:edit')}]];
        var removeFlag = [[${@permission.hasPermi('fym:user:remove')}]];
        var statusDatas = [[${@dict.getType('sys_normal_disable')}]];
        var userTypeDatas = [[${@dict.getType('fym_user_type')}]];
        var delFlagDatas = [[${@dict.getType('sys_del_flag')}]];
        var prefix = ctx + "fym/user";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                updateMultipleUrl: prefix + "/sendMsgMultiple/{ids}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
		        importUrl: prefix + "/importData",
		        importTemplateUrl: prefix + "/importTemplate",
                modalName: "防疫人员信息",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
                columns: [{
                    checkbox: true
                },
                {
                    field: 'userId',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'teamName',
                    title: '队伍名称'
                },
                {
                    field: 'userName',
                    title: '姓名'
                },
                {
                    field: 'email',
                    title: '用户邮箱'
                },
                {
                    field: 'idcard',
                    title: '身份证号'
                },
                {
                    field: 'phonenumber',
                    title: '手机号码'
                },
                {
                    field: 'firstBindingTime',
                    title: '小程序首次绑定短时间'
                },
               /*  {
                    field: 'avatar',
                    title: '头像路径'
                }, 
                {
                    field: 'status',
                    title: '帐号状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'loginIp',
                    title: '最后登录IP'
                },*/
                {
                    field: 'loginDate',
                    title: '最后登录时间'
                },
                {
                    field: 'leadOrg',
                    title: '负责统筹单位'
                },
                {
                    field: 'fromOrg',
                    title: '来源单位'
                },
                {
                    field: 'userType',
                    title: '类别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(userTypeDatas, value);
                    }
                },
                {
                    field: 'job',
                    title: '岗位'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-link btn-xs blue' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-link btn-xs red' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
	<div class="col-xs-offset-1">
		<input type="file" id="file" name="file"/>
		<div class="mt10 pt5">
			<input type="checkbox" id="updateSupport" name="updateSupport" title="如果防疫点已经存在，更新这条数据。"> 是否更新已经存在的防疫点数据
			 &nbsp;	<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
		</div>
		<font color="red" class="pull-left mt10">
			提示：仅允许导入“xls”或“xlsx”格式文件！
		</font>
	</div>
</form>
</script>
</html>